import {ref} from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore=defineStore('counter',()=>{
    //响应式数据
    const count=ref<any>(0)
    
    //定义方法
    function incerment(){
        count.value++;
    }
    function decerment(){
        count.value--;
    }
    
    //外部可访问
    return{
        count,
        incerment,
        decerment
    }
},{
	persist:true,
})  
